<?php

namespace addons\qingdong\validate;

use think\Validate;

//合同
class Contract extends Validate {
	/**
	 * 验证规则
	 */
	protected $rule = [
		'create_staff_id' => 'require|number',
		'owner_staff_id'  => 'require|number',
		'order_staff_id'  => 'require|number',
		'customer_id'     => 'require|number',
		'contacts_id'     => 'require|number',
		'name'           => 'max:50',
		'num'            => 'max:64',
		'order_date'     => 'date',
		'money'          => 'number',
		'total_price'    => 'number',
		'discount_rate'  => 'number',
		'check_status'   => 'between:0,5',
		'flow_staff_ids'  => 'max:128',
		'check_staff_ids' => 'max:128',
		'start_time'     => 'date',
		'end_time'       => 'date',
		'remarks'        => 'max:250',

	];
	/**
	 * 提示消息
	 */
	protected $message = [];
	/**
	 * 字段描述
	 */
	protected $field = [
		'create_staff_id' => '员工',
		'owner_staff_id'  => '员工',
		'order_staff_id'  => '员工',
		'customer_id'     => '所属客户',
		'contacts_id'     => '所属联系人',
		'name'            => '合同名称',
		'num'             => '合同编号',
		'order_date'      => '下单时间',
		'money'           => '金额',
		'check_status'    => '合同状态',
		'flow_staff_ids'   => '审核人',
		'start_time'      => '开始时间',
		'end_time'        => '结束时间',
		'remarks'         => '备注信息',
	];
	/**
	 * 验证场景
	 */
	protected $scene = [
		'create' => [
			'customer_id',
			'contacts_id',
			'name',
			'num',
			'order_date',
			'money',
			'check_status',
			'flow_staff_ids',
			'start_time',
			'end_time',
			'remarks'
		],
		'edit'   => [],
	];
}
